#!/usr/bin/env ruby1.9
# encoding: UTF-8

require 'term/ansicolor'

require './lib/hindo.rb'

describe Counter, "count_tweets" do

    it "Prints username in green" do
        words = mock "Words"
        word_filter = mock "WordFilter"
        tweet = mock "Tweet"
        user = mock "User"
        log = mock "Log"
	tagger = mock "Tagger"

        name = "A NAme"
        users_to_ignore = []

        words.should_receive(:load).and_return 1
        words.should_receive(:add).any_number_of_times

        user.should_receive(:screen_name).and_return "Screen Name"
        user.should_receive(:name).any_number_of_times.and_return name

        tweet.should_receive(:id).any_number_of_times.and_return 123456
        tweet.should_receive(:user).any_number_of_times.and_return user
        tweet.should_receive(:text).any_number_of_times.and_return "Text Message"

        word_filter.should_receive(:collectable?).any_number_of_times.and_return true

	tagger.should_receive(:words).and_return []

        $stdout.should_receive(:puts).with "123456, #{green(name)}, Text Messag..."

	log.should_receive(:log)
		
        counter = Counter.new(words, word_filter, users_to_ignore, log, tagger)

        counter.count(tweet)
    end

end
